<section id="modules" class="mb-5">
    <h4 class="mb-4 border-bottom pb-2">模块管理</h4>
    <div class="row g-3">
        <?php
        $modules = $pdo->query("SELECT * FROM modules ORDER BY sort_order")->fetchAll();
        foreach($modules as $module): ?>
            <div class="col-md-4">
                <div class="info-card p-3">
                    <div class="d-flex justify-content-between align-items-center mb-2">
                        <h5><?=htmlspecialchars($module['display_name'])?></h5>
                        <div class="form-check form-switch">
                            <input class="form-check-input" type="checkbox"
                                <?=$module['is_active'] ? 'checked' : ''?>
                                   data-module-id="<?=$module['id']?>">
                        </div>
                    </div>
                    <div class="text-muted small">
                        路由：<?=htmlspecialchars($module['route_path'])?>
                    </div>
                    <div class="mt-2">
                        <button class="btn btn-sm btn-outline-primary">编辑</button>
                    </div>
                </div>
            </div>
        <?php endforeach; ?>
    </div>
</section>